# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
pkgname=oha
pkgver=1.0.0
pkgrel=1
pkgdesc="Ohayou(おはよう), HTTP load generator, inspired by rakyll/hey with tui animation"
arch=('loong64' 'x86_64')
url="https://github.com/hatoo/oha"
license=('MIT')
depends=('openssl' 'gcc-libs' 'glibc')
makedepends=('rust')
options=('!lto')
source=($pkgname-$pkgver.tar.gz::https://github.com/hatoo/oha/archive/refs/tags/v${pkgver}.tar.gz)
sha512sums=('178c062cf16155e8d53c2417811f8de2f3c683745b9cbc5e289cb652324d3d9723a89e2e9d762f5b5be7e50e6d7d5be2ced344caa5670bf1b096494fea615c58')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  cargo build --release --locked
}

check() {
  cd "$srcdir/$pkgname-$pkgver"

  cargo test --release --locked
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  install -Dm755 target/release/oha "$pkgdir"/usr/bin/oha
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
